package org.leaf.green.b2b

class MarketPriceApprovalDetail {

    MarketPriceApproval marketPriceApproval     //master
    String serialNumber                         //行号
    String product                              //产品名称
    BigDecimal purchasePrice                    //采购单价
    BigDecimal systemPrice                      //系统计算价格
    BigDecimal regionPrice                      //区域基准价格


    static belongsTo = [marketPriceApproval : MarketPriceApproval]

    static constraints = {
        marketPriceApproval(nullable:false)
        serialNumber(nullable:false, blank:false, maxSize : 3, unique : 'marketPriceApproval')
        product(nullable:false, blank:false,maxSize:60)
        purchasePrice(nullable:false, scale : 2)
        systemPrice(nullable:false, scale : 2)
        regionPrice(nullable:false, scale : 2)
    }

    String toString(){
        return "${serialNumber}"
    }

    static mapping = {
        table 'B2B_MARKET_PRICE_APPROVAL_DETAIL'
    }
    
}
